#ifndef SOBJC_CLASS_H
#define SOBJC_CLASS_H

#include <sobjc/runtime.h>

#ifdef __cplusplus
extern "C" {
#ifdef 0
} /* for editor */
#endif
#endif 

#define OBJC_CLS_CLASS               0x1L
#define OBJC_CLS_META                0x2L
#define OBJC_CLS_INITIALIZED         0x4L
#define OBJC_CLS_MAPPED              0x10L
#define OBJC_CLS_FLUSH_CACHE         0x20L
#define OBJC_CLS_GROW_CACHE          0x40L
#define OBJC_CLS_NEED_BIND           0x80L
#define OBJC_CLS_METHOD_ARRAY        0x100L  /* unused */
#define OBJC_CLS_JAVA_HYBRID         0x200L  /* unused */
#define OBJC_CLS_JAVA_CLASS          0x400L  /* unused */
#define OBJC_CLS_INITIALIZING        0x800L  /* thread-safe +initialize */
#define OBJC_CLS_FROM_BUNDLE         0x1000L /* bundle unloading */
#define OBJC_CLS_HAS_CXX_STRUCTORS   0x2000L /* unused. C++ ivar support */
#define OBJC_CLS_NO_METHOD_ARRAY     0x4000L /* Lazy method list arrays */
#define OBJC_CLS_HAS_LOAD_METHOD     0x8000L /* +load implementation */

OBJC_EXPORT Class objc_make_class(const char *, Class, size_t,
                                   IvarList, ProtocolList, int);
OBJC_EXPORT Class objc_make_metaclass(Class, int);

OBJC_EXPORT const char *objc_class_get_name(Class);
OBJC_EXPORT Class objc_class_get_metaclass(Class);
OBJC_EXPORT BOOL objc_class_is_metaclass(Class);
OBJC_EXPORT Class objc_class_get_superclass(Class);
OBJC_EXPORT BOOL objc_class_is_kind_of(Class, Class);
OBJC_EXPORT unsigned int objc_class_get_flags(Class);
OBJC_EXPORT size_t objc_class_get_instance_size(Class);
OBJC_EXPORT int objc_class_get_version(Class);
OBJC_EXPORT void objc_class_set_version(Class, int);

OBJC_EXPORT ProtocolList objc_class_get_protocol_list(Class);

OBJC_EXPORT CategoryList objc_class_get_category_list(Class);
OBJC_EXPORT Category objc_class_get_category(Class, const char *);
OBJC_EXPORT void objc_class_add_category(Class, Category);

OBJC_EXPORT IvarList objc_class_get_ivar_list(Class);
OBJC_EXPORT Ivar objc_class_get_ivar(Class, const char *);

OBJC_EXPORT MethodList objc_class_get_method_list(Class);
OBJC_EXPORT Method objc_class_get_instance_method(Class, SEL);
OBJC_EXPORT Method objc_class_get_class_method(Class, SEL);
OBJC_EXPORT void objc_class_add_method(Class, Method, int);

OBJC_EXPORT IMP objc_class_get_imp(Class, SEL);
OBJC_EXPORT IMP objc_class_get_imp_super(Class, SEL);

/* unused */
OBJC_EXPORT void objc_class_set_before_method(Class cls, SEL sel, IMP imp);
OBJC_EXPORT void objc_class_set_after_method(Class cls, SEL sel, IMP imp);
OBJC_EXPORT void objc_class_set_around_method(Class cls, SEL sel, IMP imp);

OBJC_EXPORT id objc_class_make_instance(Class);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SOBJC_CLASS_H */

